<?php


namespace catchAdmin\apipatient\controller;


use app\common\exception\ApiException;
use app\common\lib\ApiDesc;
use app\common\model\BaseModel;
use app\common\model\PatientInfo;
use catcher\base\CatchController;
use catcher\exceptions\CatchException;
use catcher\exceptions\FailedException;
use thans\jwt\facade\JWTAuth;
use think\exception\HttpException;
use think\Request;

class User extends CatchController
{
    public function authentication(Request $request)
    {
        try {
            $patientId = $request->param("patient_id", "", "string");
            if (empty($patientId)) {
                throw new FailedException("请传入患者ID", ApiDesc::INVALID_REQUEST[0], null, [], ApiDesc::INVALID_REQUEST[2]);
            }
            //根据患者id获取患者信息
            $patientInfo = (new PatientInfo())->getInfo($patientId);
            //生成jwttoken
        } catch (\Exception $exception) {
            throw new FailedException($exception->getMessage(), $exception->getCode(), null, [], ApiDesc::Unauthorized[2]);
        }


    }
}